package com.a.basis.testexpand;

import java.util.Arrays;

//          数组的扩容3
public class TestExpand3 {
    public static void main(String[] args) {
        int[] oldArray=new int[]{1,2,3,4,5};

        int[] newArray=Arrays.copyOf(oldArray,oldArray.length*2);

        for (int i = 0; i < newArray.length; i++) {
            System.out.print(newArray[i]+"\t");
        }

    }
}
